<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 将数组用 | 或 其他符号连接成一个字符串


    //sconsole.log(str);




    var arr = ['name', '某某', 'age', 18, 'sex', 0];

    var str = arr.join('|');
    // name | 某某 | age | 18 | sex | 0
    console.log(str);

    var str1 = arr.join('=');
    // name = 某某 = age = 18 = sex = 0
    console.log(str1);

  </script>
</body>

</html>